package com.interview.algorithm;

/**
 * Copyright (C), 2018-2020
 * FileName: 阶乘
 * Author:   kongfanyu
 * Date:     2020/12/28 下午4:53
 */
public class 阶乘 {

    public static void main(String[] args) {
        System.out.println(test(5));
    }

    public static  int test(int n){
        if (n == 1){
            return 1;
        }else {
            return n * test(n-1);
        }
    }

}
